﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="wizyta.aspx.cs" Inherits="STS.wizyta1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Label ID="id_pacjenta" runat="server" Text="Label" Visible="False"></asp:Label>
<asp:Label ID="tekst" runat="server" Text="Label" Visible="False"></asp:Label>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:MGRConnectionString %>" 
    SelectCommand="SELECT * FROM [wizyta]" 
    DeleteCommand="DELETE FROM [wizyta] WHERE [id_wizyty] = @id_wizyty" 
    InsertCommand="INSERT INTO [wizyta] ([waga], [cisnienie], [data], [id_pacjenta], [id_lekarza]) VALUES (NOW(), @cisnienie, @data, @id_pacjenta, @id_lekarza)" 
    UpdateCommand="UPDATE [wizyta] SET [waga] = @waga, [cisnienie] = @cisnienie, [data] = @data, [id_pacjenta] = @id_pacjenta, [id_lekarza] = @id_lekarza WHERE [id_wizyty] = @id_wizyty">
    <DeleteParameters>
        <asp:Parameter Name="id_wizyty" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="waga" Type="Double" />
        <asp:Parameter Name="cisnienie" Type="String" />
        <asp:Parameter DbType="Date" DefaultValue="" Name="data" />
        <asp:ControlParameter ControlID="id_pacjenta" Name="id_pacjenta" 
            PropertyName="Text" Type="Int32" />
        <asp:CookieParameter CookieName="id" Name="id_lekarza" Type="Int32" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="waga" Type="Double" />
        <asp:Parameter Name="cisnienie" Type="String" />
        <asp:Parameter DbType="Date" Name="data" />
        <asp:Parameter Name="id_pacjenta" Type="Int32" />
        <asp:Parameter Name="id_lekarza" Type="Int32" />
        <asp:Parameter Name="id_wizyty" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
    DataKeyNames="id_wizyty" DataSourceID="SqlDataSource1" Height="50px" 
    Width="125px" DefaultMode="Insert">
    <Fields>
        <asp:BoundField DataField="id_wizyty" HeaderText="id_wizyty" 
            SortExpression="id_wizyty" InsertVisible="False" ReadOnly="True" 
            Visible="False" />
        <asp:BoundField DataField="waga" HeaderText="waga" SortExpression="waga" />
        <asp:BoundField DataField="cisnienie" HeaderText="cisnienie" 
            SortExpression="cisnienie" />
        <asp:BoundField DataField="data" HeaderText="data" SortExpression="data" 
            Visible="False" />
        <asp:BoundField DataField="id_pacjenta" HeaderText="id_pacjenta" 
            SortExpression="id_pacjenta" Visible="False" />
        <asp:BoundField DataField="id_lekarza" HeaderText="id_lekarza" 
            SortExpression="id_lekarza" Visible="False" />
        <asp:CommandField ButtonType="Button" NewText="Dodaj" ShowInsertButton="True" />
    </Fields>
</asp:DetailsView>
<asp:Panel ID="Panel1" runat="server">
</asp:Panel>
</asp:Content>
